<%-- 
    Document   : DetailBook
    Created on : Nov 1, 2011, 11:37:23 PM
    Author     : MrKoi
--%>

<%@page import="DAL.CarBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
         <style type="text/css">
             .khun
                {
                    background-color:#dfe0dd;
                    width:500px;
                    margin-left:auto;
                    margin-right:auto;
                    margin-top:20px;
                }  
                 table
                {
                margin-left:auto;
                margin-right:auto;
                }
                .font
                {
                font-family:"Times New Roman", Times, serif;
                font-size:x-large;
                font-weight:bold;
                width:200px;
                height:30px;
                margin-left:auto;
                margin-right:auto;
                }
                .noidung
                {
                font-family:"Times New Roman", Times, serif;
                color:black;
                font-size:medium;
                font-weight:bold;
                }
                
        </style>
    </head>
    <body>
    <%
        String username="",carid="",driver="",PickUpDate="",DropOffDate="",pack="",number="",totalmoney="";
        if(session.getAttribute("carid")!=null)
            {
               username=session.getAttribute("User").toString();
               carid=session.getAttribute("carid").toString();
               driver=session.getAttribute("driver").toString();
               PickUpDate=session.getAttribute("PickUpDate").toString();
               DropOffDate=session.getAttribute("DropOffDate").toString();
               pack=session.getAttribute("pack").toString();
               number=session.getAttribute("number").toString();
               totalmoney=session.getAttribute("totalmoney").toString();
               
               CarBean cb=new CarBean();
               Collection coll=cb.SelectCarID(carid);
               request.setAttribute("carb",coll);
            }
    %>
    <div class="khun">
            <div class="font">Detail Book</div>
            <table border="0" width="400px" cellpadding="3" cellspacing="3">            
                <form action="ControllerCarBook" method="get" name="detail" enctype="multipart/form-data">
                    <tr>
                        <td><input type="hidden" name="username" value="<%=username%>" /></td>
                        <td><input type="hidden" name="carid" value="<%=carid%>" /></td>
                    </tr>
                    <c:forEach items="${carb}" var="cbid" >
                        <tr>
                            <td>Name Car: </td>
                            <td>${cbid.carName}</td>
                        </tr>
                        <tr>
                            <td>Image:</td>
                            <td><img src="${cbid.image}" border="1" alt="${cbid.carName}" width="100px" height="100px"/></td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <td colspan="2"><hr></td>
                    </tr>
                    <tr>
                        <td colspan="2" class="noidung">Information Car Rental</td>
                    </tr>
                    <tr>
                        <td>Driver:</td>
                        <td><input type="hidden" name="driver" value="<%=driver%>"/><%=driver%></td>
                    </tr>
                    <tr>
                        <td>Pick Up Date:</td>
                        <td valign="bottom"><input type="hidden" name="PickUpDate" value="<%=PickUpDate%>" /><%=PickUpDate%></td>
                    </tr>
                    <tr>
                        <td>Drop Off Date:</td>
                        <td valign="bottom"><input type="hidden" name="DropOffDate" value="<%=DropOffDate%>" /><%=DropOffDate%></td> 
                    </tr>
                    <tr>
                        <td>Time Rent:</td>
                        <td>
                            <input type="hidden" name="number" value="<%=number%>"/><%=number%>
                            <input type="hidden" name="pack" value="<%=pack%>"/> <%=pack%>
                        </td>
                    </tr>
                    <tr>
                        <td>Total Money:</td>
                        <td style="color:red;"><input type="hidden" name="totalmoney" value="<%=totalmoney%>"/><f:formatNumber value="<%=totalmoney%>" pattern="$#,###"  /></td>
                    </tr>
                     <tr>
                        <td colspan="2" class="noidung">Click comfirm to car Rental</td>
                    </tr>
                    <tr>
                        <td colspan="2"><hr></td>
                    </tr>
                    <tr>
                    <td align="right"><input type="submit" name="comfirm" value="Comfirm"/></td>

                </form>
                <form action="ControllerCarBook" method="post" name="cancel">
                    <td align="left">
                        <input type="submit" name="cancel" value="Cancel" />
                    </td>
                </form>
                </tr>
            </table>
    </div>
    </body>
</html>
